//分类
var current_city1  = document.querySelector("#current-city1");
var current_city = document.querySelector("#current-city");

//移入分类按钮
current_city1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    current_city.style.display = "block";

});
current_city1.addEventListener("mouseleave",function(){
    current_city.style.display = "none" ;
});
//移入详情
current_city.addEventListener("mouseover",function(){
    current_city.style.display = "block";
});
//移除详情
current_city.addEventListener("mouseleave",function(){
    current_city.style.display = "none";
});


var u1  = document.querySelector("#u1");
var messageList = document.querySelector("#messageList");

//移入分类按钮
u1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    messageList.style.display = "block";

});
u1.addEventListener("mouseleave",function(){
    messageList.style.display = "none" ;
});
//移入详情
messageList.addEventListener("mouseover",function(){
    messageList.style.display = "block";
});
//移除详情
messageList.addEventListener("mouseleave",function(){
    messageList.style.display = "none";
});


var u  = document.querySelector("#u");
var app_list = document.querySelector("#app-list");

//移入分类按钮
u.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list.style.display = "block";

});
u.addEventListener("mouseleave",function(){
    app_list.style.display = "none" ;
});
//移入详情
app_list.addEventListener("mouseover",function(){
    app_list.style.display = "block";
});
//移除详情
app_list.addEventListener("mouseleave",function(){
    app_list.style.display = "none";
});

var nii = document.querySelector("#nii");

//滚动条事件，滚动触发一次，这个事件就会执行一次
window.onscroll = function(){
    console.log(document.documentElement.scrollTop || document.body.scrollTop);

    //判断它距离顶部的位置
    if (document.documentElement.scrollTop > 1000 || document.body.scrollTop >500){
        nii.style.display = "block";
    }else {
        nii.style.display = "none";
    }
};

nii.addEventListener('click',function(){
    //滚动到指定位置
    window.scrollTo(0,0);

    //window.scrollTo({
    //    top1: 0,
    //    behavior:'smoooth'
    //})
});



var e  = document.querySelector("#e");
var app_list1 = document.querySelector("#app-list1");

//移入分类按钮
e.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list1.style.display = "block";

});
e.addEventListener("mouseleave",function(){
    app_list1.style.display = "none" ;
});
//移入详情
app_list1.addEventListener("mouseover",function(){
    app_list1.style.display = "block";
});
//移除详情
app_list1.addEventListener("mouseleave",function(){
    app_list1.style.display = "none";
});


var e1  = document.querySelector("#e1");
var app_list2 = document.querySelector("#app-list2");

//移入分类按钮
e1.addEventListener("mouseover",function(){
    //移入的时候，执行显示分类详情
    app_list2.style.display = "block";

});
e1.addEventListener("mouseleave",function(){
    app_list2.style.display = "none" ;
});
//移入详情
app_list2.addEventListener("mouseover",function(){
    app_list2.style.display = "block";
});
//移除详情
app_list2.addEventListener("mouseleave",function(){
    app_list2.style.display = "none";
});
